{{if _type == 'account'}}
  <h1>${i18n('heading_login')}</h1>
  <div class="login-content">
    <div class="left">
      <h2>${i18n('text_new_customer')}</h2>
      <div class="content">
        <p><b>${i18n('text_register')}</b></p>
        <p>${i18n('text_register_account')}</p>
        <a href="#/account/register" class="button"><span>${i18n('button_continue')}</span></a></div>
    </div>
    <div class="right">
{{/if}}

<h2>${i18n('text_returning_customer')}</h2>
<div class="warning login-warning" style="display: none">${i18n('secure.error')}</div>
<form action="#/account/login" method="post" enc_type="application/x-www-form-urlencoded" accept-charset="utf-8" id="login${_type}">
  <input type="hidden" name="_url" value="${_url}"/>
  <input type="submit" style="display: none;">
  <div class="content" style="padding-top: 15px">
    <table class="login-form">
      {{if _type == 'account'}}
      <tr>
        <td colspan="3"><b>${i18n('text_i_am_returning_customer')}</b></td>
      </tr>
      {{/if}}
      <tr>
        <td><label for="username">${i18n('entry_email')}</label></td>
        <td><input type="text" name="username" value="${params.username}" tabindex="1" {{if _type == 'account'}}autofocus="true"{{/if}}/></td>
        <td><input type="checkbox" name="remember" id="remember" tabindex="3"/>
          <label for="remember">${i18n('secure.remember')}</label></td>
      </tr>
      <tr>
        <td><label for="password">${i18n('entry_password')}</label></td>
        <td><input type="password" name="password" value="" tabindex="2"/>
        </td>
        <td><a href="#">${i18n('text_forgotten')}</a></td>
      </tr>
      <tr>
        <td colspan="3">
          <a onclick="$('#login${_type}').submit();" class="button"><span>${i18n('button_login')}</span></a>
        </td>
    </table>
  </div>
</form>

{{if _type == 'account'}}
    </div>
  </div>
{{/if}}

<script _type="text/javascript">
  $('input[autofocus]').first().focus();
   
  $("#login${_type}").validate({
    rules: {
      username: {
        required: true,
        email: true
      },
      password: "required"
    },
    messages: {
      username: i18n('error_username'),
      password: i18n('error_login_password')
    },
    onkeyup: false
  });

</script>